/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package ve.com.fitsoft.eicb.encuesta.SB.service.persistence;

import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil;
import com.liferay.portal.kernel.dao.orm.DynamicQuery;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.kernel.util.ReferenceRegistry;
import com.liferay.portal.service.ServiceContext;

import ve.com.fitsoft.eicb.encuesta.SB.model.Pregunta;

import java.util.List;

/**
 * The persistence utility for the pregunta service. This utility wraps {@link PreguntaPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
 *
 * <p>
 * Caching information and settings can be found in <code>portal.properties</code>
 * </p>
 *
 * @author leo
 * @see PreguntaPersistence
 * @see PreguntaPersistenceImpl
 * @generated
 */
public class PreguntaUtil {
	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
	 */

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
	 */
	public static void clearCache() {
		getPersistence().clearCache();
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
	 */
	public static void clearCache(Pregunta pregunta) {
		getPersistence().clearCache(pregunta);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
	 */
	public long countWithDynamicQuery(DynamicQuery dynamicQuery)
		throws SystemException {
		return getPersistence().countWithDynamicQuery(dynamicQuery);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
	 */
	public static List<Pregunta> findWithDynamicQuery(DynamicQuery dynamicQuery)
		throws SystemException {
		return getPersistence().findWithDynamicQuery(dynamicQuery);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
	 */
	public static List<Pregunta> findWithDynamicQuery(
		DynamicQuery dynamicQuery, int start, int end)
		throws SystemException {
		return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
	 */
	public static List<Pregunta> findWithDynamicQuery(
		DynamicQuery dynamicQuery, int start, int end,
		OrderByComparator orderByComparator) throws SystemException {
		return getPersistence()
				   .findWithDynamicQuery(dynamicQuery, start, end,
			orderByComparator);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
	 */
	public static Pregunta update(Pregunta pregunta, boolean merge)
		throws SystemException {
		return getPersistence().update(pregunta, merge);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
	 */
	public static Pregunta update(Pregunta pregunta, boolean merge,
		ServiceContext serviceContext) throws SystemException {
		return getPersistence().update(pregunta, merge, serviceContext);
	}

	/**
	* Caches the pregunta in the entity cache if it is enabled.
	*
	* @param pregunta the pregunta
	*/
	public static void cacheResult(
		ve.com.fitsoft.eicb.encuesta.SB.model.Pregunta pregunta) {
		getPersistence().cacheResult(pregunta);
	}

	/**
	* Caches the preguntas in the entity cache if it is enabled.
	*
	* @param preguntas the preguntas
	*/
	public static void cacheResult(
		java.util.List<ve.com.fitsoft.eicb.encuesta.SB.model.Pregunta> preguntas) {
		getPersistence().cacheResult(preguntas);
	}

	/**
	* Creates a new pregunta with the primary key. Does not add the pregunta to the database.
	*
	* @param idPregunta the primary key for the new pregunta
	* @return the new pregunta
	*/
	public static ve.com.fitsoft.eicb.encuesta.SB.model.Pregunta create(
		long idPregunta) {
		return getPersistence().create(idPregunta);
	}

	/**
	* Removes the pregunta with the primary key from the database. Also notifies the appropriate model listeners.
	*
	* @param idPregunta the primary key of the pregunta
	* @return the pregunta that was removed
	* @throws ve.com.fitsoft.eicb.encuesta.SB.NoSuchPreguntaException if a pregunta with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static ve.com.fitsoft.eicb.encuesta.SB.model.Pregunta remove(
		long idPregunta)
		throws com.liferay.portal.kernel.exception.SystemException,
			ve.com.fitsoft.eicb.encuesta.SB.NoSuchPreguntaException {
		return getPersistence().remove(idPregunta);
	}

	public static ve.com.fitsoft.eicb.encuesta.SB.model.Pregunta updateImpl(
		ve.com.fitsoft.eicb.encuesta.SB.model.Pregunta pregunta, boolean merge)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().updateImpl(pregunta, merge);
	}

	/**
	* Returns the pregunta with the primary key or throws a {@link ve.com.fitsoft.eicb.encuesta.SB.NoSuchPreguntaException} if it could not be found.
	*
	* @param idPregunta the primary key of the pregunta
	* @return the pregunta
	* @throws ve.com.fitsoft.eicb.encuesta.SB.NoSuchPreguntaException if a pregunta with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static ve.com.fitsoft.eicb.encuesta.SB.model.Pregunta findByPrimaryKey(
		long idPregunta)
		throws com.liferay.portal.kernel.exception.SystemException,
			ve.com.fitsoft.eicb.encuesta.SB.NoSuchPreguntaException {
		return getPersistence().findByPrimaryKey(idPregunta);
	}

	/**
	* Returns the pregunta with the primary key or returns <code>null</code> if it could not be found.
	*
	* @param idPregunta the primary key of the pregunta
	* @return the pregunta, or <code>null</code> if a pregunta with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static ve.com.fitsoft.eicb.encuesta.SB.model.Pregunta fetchByPrimaryKey(
		long idPregunta)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().fetchByPrimaryKey(idPregunta);
	}

	/**
	* Returns all the preguntas where groupId = &#63; and idEncuesta = &#63;.
	*
	* @param groupId the group ID
	* @param idEncuesta the id encuesta
	* @return the matching preguntas
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<ve.com.fitsoft.eicb.encuesta.SB.model.Pregunta> findByencuesta(
		long groupId, long idEncuesta)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByencuesta(groupId, idEncuesta);
	}

	/**
	* Returns a range of all the preguntas where groupId = &#63; and idEncuesta = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param groupId the group ID
	* @param idEncuesta the id encuesta
	* @param start the lower bound of the range of preguntas
	* @param end the upper bound of the range of preguntas (not inclusive)
	* @return the range of matching preguntas
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<ve.com.fitsoft.eicb.encuesta.SB.model.Pregunta> findByencuesta(
		long groupId, long idEncuesta, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByencuesta(groupId, idEncuesta, start, end);
	}

	/**
	* Returns an ordered range of all the preguntas where groupId = &#63; and idEncuesta = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param groupId the group ID
	* @param idEncuesta the id encuesta
	* @param start the lower bound of the range of preguntas
	* @param end the upper bound of the range of preguntas (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of matching preguntas
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<ve.com.fitsoft.eicb.encuesta.SB.model.Pregunta> findByencuesta(
		long groupId, long idEncuesta, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .findByencuesta(groupId, idEncuesta, start, end,
			orderByComparator);
	}

	/**
	* Returns the first pregunta in the ordered set where groupId = &#63; and idEncuesta = &#63;.
	*
	* @param groupId the group ID
	* @param idEncuesta the id encuesta
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching pregunta
	* @throws ve.com.fitsoft.eicb.encuesta.SB.NoSuchPreguntaException if a matching pregunta could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static ve.com.fitsoft.eicb.encuesta.SB.model.Pregunta findByencuesta_First(
		long groupId, long idEncuesta,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			ve.com.fitsoft.eicb.encuesta.SB.NoSuchPreguntaException {
		return getPersistence()
				   .findByencuesta_First(groupId, idEncuesta, orderByComparator);
	}

	/**
	* Returns the first pregunta in the ordered set where groupId = &#63; and idEncuesta = &#63;.
	*
	* @param groupId the group ID
	* @param idEncuesta the id encuesta
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching pregunta, or <code>null</code> if a matching pregunta could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static ve.com.fitsoft.eicb.encuesta.SB.model.Pregunta fetchByencuesta_First(
		long groupId, long idEncuesta,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .fetchByencuesta_First(groupId, idEncuesta, orderByComparator);
	}

	/**
	* Returns the last pregunta in the ordered set where groupId = &#63; and idEncuesta = &#63;.
	*
	* @param groupId the group ID
	* @param idEncuesta the id encuesta
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching pregunta
	* @throws ve.com.fitsoft.eicb.encuesta.SB.NoSuchPreguntaException if a matching pregunta could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static ve.com.fitsoft.eicb.encuesta.SB.model.Pregunta findByencuesta_Last(
		long groupId, long idEncuesta,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			ve.com.fitsoft.eicb.encuesta.SB.NoSuchPreguntaException {
		return getPersistence()
				   .findByencuesta_Last(groupId, idEncuesta, orderByComparator);
	}

	/**
	* Returns the last pregunta in the ordered set where groupId = &#63; and idEncuesta = &#63;.
	*
	* @param groupId the group ID
	* @param idEncuesta the id encuesta
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching pregunta, or <code>null</code> if a matching pregunta could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static ve.com.fitsoft.eicb.encuesta.SB.model.Pregunta fetchByencuesta_Last(
		long groupId, long idEncuesta,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .fetchByencuesta_Last(groupId, idEncuesta, orderByComparator);
	}

	/**
	* Returns the preguntas before and after the current pregunta in the ordered set where groupId = &#63; and idEncuesta = &#63;.
	*
	* @param idPregunta the primary key of the current pregunta
	* @param groupId the group ID
	* @param idEncuesta the id encuesta
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the previous, current, and next pregunta
	* @throws ve.com.fitsoft.eicb.encuesta.SB.NoSuchPreguntaException if a pregunta with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static ve.com.fitsoft.eicb.encuesta.SB.model.Pregunta[] findByencuesta_PrevAndNext(
		long idPregunta, long groupId, long idEncuesta,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			ve.com.fitsoft.eicb.encuesta.SB.NoSuchPreguntaException {
		return getPersistence()
				   .findByencuesta_PrevAndNext(idPregunta, groupId, idEncuesta,
			orderByComparator);
	}

	/**
	* Returns all the preguntas that the user has permission to view where groupId = &#63; and idEncuesta = &#63;.
	*
	* @param groupId the group ID
	* @param idEncuesta the id encuesta
	* @return the matching preguntas that the user has permission to view
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<ve.com.fitsoft.eicb.encuesta.SB.model.Pregunta> filterFindByencuesta(
		long groupId, long idEncuesta)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().filterFindByencuesta(groupId, idEncuesta);
	}

	/**
	* Returns a range of all the preguntas that the user has permission to view where groupId = &#63; and idEncuesta = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param groupId the group ID
	* @param idEncuesta the id encuesta
	* @param start the lower bound of the range of preguntas
	* @param end the upper bound of the range of preguntas (not inclusive)
	* @return the range of matching preguntas that the user has permission to view
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<ve.com.fitsoft.eicb.encuesta.SB.model.Pregunta> filterFindByencuesta(
		long groupId, long idEncuesta, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .filterFindByencuesta(groupId, idEncuesta, start, end);
	}

	/**
	* Returns an ordered range of all the preguntas that the user has permissions to view where groupId = &#63; and idEncuesta = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param groupId the group ID
	* @param idEncuesta the id encuesta
	* @param start the lower bound of the range of preguntas
	* @param end the upper bound of the range of preguntas (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of matching preguntas that the user has permission to view
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<ve.com.fitsoft.eicb.encuesta.SB.model.Pregunta> filterFindByencuesta(
		long groupId, long idEncuesta, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .filterFindByencuesta(groupId, idEncuesta, start, end,
			orderByComparator);
	}

	/**
	* Returns the preguntas before and after the current pregunta in the ordered set of preguntas that the user has permission to view where groupId = &#63; and idEncuesta = &#63;.
	*
	* @param idPregunta the primary key of the current pregunta
	* @param groupId the group ID
	* @param idEncuesta the id encuesta
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the previous, current, and next pregunta
	* @throws ve.com.fitsoft.eicb.encuesta.SB.NoSuchPreguntaException if a pregunta with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static ve.com.fitsoft.eicb.encuesta.SB.model.Pregunta[] filterFindByencuesta_PrevAndNext(
		long idPregunta, long groupId, long idEncuesta,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			ve.com.fitsoft.eicb.encuesta.SB.NoSuchPreguntaException {
		return getPersistence()
				   .filterFindByencuesta_PrevAndNext(idPregunta, groupId,
			idEncuesta, orderByComparator);
	}

	/**
	* Returns all the preguntas.
	*
	* @return the preguntas
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<ve.com.fitsoft.eicb.encuesta.SB.model.Pregunta> findAll()
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findAll();
	}

	/**
	* Returns a range of all the preguntas.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of preguntas
	* @param end the upper bound of the range of preguntas (not inclusive)
	* @return the range of preguntas
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<ve.com.fitsoft.eicb.encuesta.SB.model.Pregunta> findAll(
		int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findAll(start, end);
	}

	/**
	* Returns an ordered range of all the preguntas.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of preguntas
	* @param end the upper bound of the range of preguntas (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of preguntas
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<ve.com.fitsoft.eicb.encuesta.SB.model.Pregunta> findAll(
		int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findAll(start, end, orderByComparator);
	}

	/**
	* Removes all the preguntas where groupId = &#63; and idEncuesta = &#63; from the database.
	*
	* @param groupId the group ID
	* @param idEncuesta the id encuesta
	* @throws SystemException if a system exception occurred
	*/
	public static void removeByencuesta(long groupId, long idEncuesta)
		throws com.liferay.portal.kernel.exception.SystemException {
		getPersistence().removeByencuesta(groupId, idEncuesta);
	}

	/**
	* Removes all the preguntas from the database.
	*
	* @throws SystemException if a system exception occurred
	*/
	public static void removeAll()
		throws com.liferay.portal.kernel.exception.SystemException {
		getPersistence().removeAll();
	}

	/**
	* Returns the number of preguntas where groupId = &#63; and idEncuesta = &#63;.
	*
	* @param groupId the group ID
	* @param idEncuesta the id encuesta
	* @return the number of matching preguntas
	* @throws SystemException if a system exception occurred
	*/
	public static int countByencuesta(long groupId, long idEncuesta)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().countByencuesta(groupId, idEncuesta);
	}

	/**
	* Returns the number of preguntas that the user has permission to view where groupId = &#63; and idEncuesta = &#63;.
	*
	* @param groupId the group ID
	* @param idEncuesta the id encuesta
	* @return the number of matching preguntas that the user has permission to view
	* @throws SystemException if a system exception occurred
	*/
	public static int filterCountByencuesta(long groupId, long idEncuesta)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().filterCountByencuesta(groupId, idEncuesta);
	}

	/**
	* Returns the number of preguntas.
	*
	* @return the number of preguntas
	* @throws SystemException if a system exception occurred
	*/
	public static int countAll()
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().countAll();
	}

	public static PreguntaPersistence getPersistence() {
		if (_persistence == null) {
			_persistence = (PreguntaPersistence)PortletBeanLocatorUtil.locate(ve.com.fitsoft.eicb.encuesta.SB.service.ClpSerializer.getServletContextName(),
					PreguntaPersistence.class.getName());

			ReferenceRegistry.registerReference(PreguntaUtil.class,
				"_persistence");
		}

		return _persistence;
	}

	/**
	 * @deprecated
	 */
	public void setPersistence(PreguntaPersistence persistence) {
	}

	private static PreguntaPersistence _persistence;
}